import { defineConfig } from "vite";
import path from "path";
import vue from "@vitejs/plugin-vue";
// 自动导入ui和组件
import Components from "unplugin-vue-components/vite";
// element
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  server: {
    proxy: {
      '/standard': {
        target: 'http://localhost:3000/',
        changeOrigin: true,
        // rewrite(path) {
        //   return path.replace('/api/bigdataos/mock_cdp/', '/mock_cdp/')
        // }
      },
    },
  },
  plugins: [vue(), Components({ resolvers: [ElementPlusResolver()] })],
});
